import request from '@/utils/request'

// 获取订单列表
export function pageApartOrder(query) {
  return request({
    url: '/order/apartOrder/paging',
    method: 'get',
    params: query
  })
}

// 获取截停订单列表
export function pageStopProjectOrder(query) {
  return request({
    url: '/order/apartOrder/stopOrderPaging',
    method: 'get',
    params: query
  })
}

// 统计订单情况
export function statApartOrder(query) {
  return request({
    url: '/order/apartOrder/statApartOrder',
    method: 'get',
    params: query
  })
}

// 根据子订单id获取订单信息
export function getApartOrder(apartOrderId) {
  return request({
    url: '/order/apartOrder/getApartOrder',
    method: 'get',
    params: { apartOrderId }
  })
}

// 撤销分仓
export function doCancelWarehouse(apartOrderId) {
  return request({
    url: '/order/apartOrder/doCancelWarehouse',
    method: 'post',
    data: { apartOrderId }
  })
}

// 重新分仓
export function doResetWarehouse(apartOrderId) {
  return request({
    url: '/order/apartOrder/doResetWarehouse',
    method: 'post',
    data: { apartOrderId }
  })
}

// 批量重新分仓
export function batchResetWarehouse(apartOrderIds) {
  return request({
    url: '/order/apartOrder/batchResetWarehouse',
    method: 'post',
    data: { apartOrderIds }
  })
}

// 指定分仓
export function doSetWarehouse(apartOrderId, warehouseId) {
  return request({
    url: '/order/apartOrder/doSetWarehouse',
    method: 'post',
    data: { apartOrderId, warehouseId }
  })
}

// 批量指定分仓
export function batchSetWarehouse(apartOrderIds, warehouseId) {
  return request({
    url: '/order/apartOrder/batchSetWarehouse',
    method: 'post',
    data: { apartOrderIds, warehouseId }
  })
}

// 子订单商品详情
export function listGoodsListByApartOrderId(apartOrderId) {
  return request({
    url: '/order/apartOrder/listGoodsListByApartOrderId',
    method: 'get',
    params: { apartOrderId }
  })
}
// 获取报关失败订单列表
export function pagingCustomsFailedOrderList(query) {
  return request({
    url: '/order/apartOrder/pagingCustomsFailedOrderList',
    method: 'get',
    params: query
  })
}

// 重推支付报关
export function doResetCustomsReDeclaration(apartOrderId) {
  return request({
    url: '/order/apartOrder/doResetCustomsReDeclaration',
    method: 'post',
    data: { apartOrderId }
  })
}

// 统计订单情况
export function statCustomsFailedpartOrder(query) {
  return request({
    url: '/order/apartOrder/statCustomsFailedpartOrder',
    method: 'get',
    params: query
  })
}
